#ifndef INC_BUMLSPAINTER_H
#define INC_BUMLSPAINTER_H

#include <QPainter>
#include <map>

/**
 * This class uses QPainter to draw formatted text using BUMLS syntax.
 *
 * Possibly it should be a subclass of QPainter, but I didn't want to take the
 * effort.
 */
class BumlsPainter
{
public:
	/**
	 * @param painter the QPainter with which to draw text
	 */
	BumlsPainter(QPainter& painter);

	void drawText(const QRectF&, QString text);

protected:
	/**
	 * Template Method
	 *
	 * @return map of character substitutions to make when drawing text
	 */
	virtual const std::map<QString, QChar>& subs();

private:
	QPainter& _painter;
};

#endif // INC_BUMLSPAINTER_H

